<html>
<head><meta charset="utf-8"><title>unstable variants for #[non_exhaustive] enums? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/unstable.20variants.20for.20.23.5Bnon_exhaustive.5D.20enums.3F.html">unstable variants for #[non_exhaustive] enums?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="239530062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/unstable%20variants%20for%20%23%5Bnon_exhaustive%5D%20enums%3F/near/239530062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/unstable.20variants.20for.20.23.5Bnon_exhaustive.5D.20enums.3F.html#239530062">(May 20 2021 at 03:47)</a>:</h4>
<p>For an enum marked as #[non_exhaustive], would it be reasonable to allow unstable enum variants? Stable code couldn't match those variants, but for a #[non_exhaustive] enum that seems potentially acceptable.</p>



<a name="239530134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/unstable%20variants%20for%20%23%5Bnon_exhaustive%5D%20enums%3F/near/239530134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/unstable.20variants.20for.20.23.5Bnon_exhaustive.5D.20enums.3F.html#239530134">(May 20 2021 at 03:48)</a>:</h4>
<p>Other members of <span class="user-group-mention" data-user-group-id="1977">@T-lang</span> felt that it seemed reasonable if (and only if) <span class="user-group-mention" data-user-group-id="492">@T-compiler</span> thought it was feasible.</p>



<a name="239539909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/unstable%20variants%20for%20%23%5Bnon_exhaustive%5D%20enums%3F/near/239539909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/unstable.20variants.20for.20.23.5Bnon_exhaustive.5D.20enums.3F.html#239539909">(May 20 2021 at 06:15)</a>:</h4>
<p>From the stability checker logic I'd expect unstable variants on any enums to already be supported.<br>
Someone needs to check whether it actually works because it was never tested since standard library is the only user of stability attributes and it didn't have unstable variants previously.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>